#!/bin/bash
#
# helper script for updating .po file(s)
#

set -e

GUIDIR=GUI/
GUIFILES=xrc
TMP_GETTEXT=XRC_gettext_file
SRC_DIR="."
draw3_LOCALES_TMP=${SRC_DIR}/draw3.tpo

wxrc -g ${SRC_DIR}/${GUIDIR}*.${GUIFILES} > ${SRC_DIR}/${TMP_GETTEXT}.h
xgettext -o ${draw3_LOCALES_TMP} -L C++ --keyword=_  ${SRC_DIR}/*.cpp ${SRC_DIR}/*.h ${SRC_DIR}/include/*.h
msgmerge -U ${SRC_DIR}/pl/draw3.po ${draw3_LOCALES_TMP}
#msgmerge -U ${SRC_DIR}/fr/draw3.po ${draw3_LOCALES_TMP}
#msgmerge -U ${SRC_DIR}/de/draw3.po ${draw3_LOCALES_TMP}
rm -f ${draw3_LOCALES_TMP}
rm ${SRC_DIR}/${TMP_GETTEXT}.h
